﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using DataAccessClasses;

namespace eschoolBO
{
    public class parent_feedback
    {
        iDAC DAC = DACFactory.GetDAC();
        private long _pfeedback_id = -99;
        private long _parent_id = -99;
        private long _teacher_id = -99;
        private string _feedback = "";
        private bool _isdeleted = false;
        public long pfeedback_id
        {
            get
            {
                return _pfeedback_id;
            }
            set
            {
                _pfeedback_id = value;
            }
        }
        public long parent_id
        {
            get
            {
                return _parent_id;
            }
            set
            {
                _parent_id = value;
            }
        }
        public long teacher_id
        {
            get
            {
                return _teacher_id;
            }
            set
            {
                _teacher_id = value;
            }
        }
        public string feedback
        {
            get
            {
                return _feedback;
            }
            set
            {
                _feedback = value;
            }
        }
        public bool isdeleted
        {
            get
            {
                return _isdeleted;
            }
            set
            {
                _isdeleted = value;
            }
        }
        public long SaveRecords()
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@pfeedback_id", pfeedback_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@parent_id", parent_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@teacher_id", teacher_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@feedback", feedback, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@isdeleted", isdeleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4 };
                return DAC.Save("parent_feedback_save", dbparamcall);
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return -99;
        }
        public DataTable GetRecords(long pfeedback_id, long parent_id, long teacher_id, string feedback, bool isdeleted, string paraandor)
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@pfeedback_id", pfeedback_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@parent_id", parent_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@teacher_id", teacher_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@feedback", feedback, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@isdeleted", isdeleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter dbparam5 = DAC.Parameter("@paraandor", paraandor, DbType.AnsiString, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4, dbparam5 };
                DataTable dt1 = DAC.Select("parent_feedback_get", dbparamcall);
                return dt1;
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return null;
        }
    }
}
